package com.swe.chums.dao.model;

import com.swe.chums.dao.model.*;
import com.swe.chums.dao.factory.*;
import com.swe.chums.dao.exceptions.*;
import java.io.Serializable;
import java.util.*;

public class CourseRelation implements Serializable
{
	/** 
	 * This attribute maps to the column id in the course_relation table.
	 */
	protected int id;

	/** 
	 * This attribute maps to the column course_id in the course_relation table.
	 */
	protected int courseId;

	/** 
	 * This attribute maps to the column instructor_id in the course_relation table.
	 */
	protected int instructorId;

	/** 
	 * This attribute maps to the column institution_id in the course_relation table.
	 */
	protected int institutionId;

	/**
	 * Method 'CourseRelation'
	 * 
	 */
	public CourseRelation()
	{
	}

	/**
	 * Method 'getId'
	 * 
	 * @return int
	 */
	public int getId()
	{
		return id;
	}

	/**
	 * Method 'setId'
	 * 
	 * @param id
	 */
	public void setId(int id)
	{
		this.id = id;
	}

	/**
	 * Method 'getCourseId'
	 * 
	 * @return int
	 */
	public int getCourseId()
	{
		return courseId;
	}

	/**
	 * Method 'setCourseId'
	 * 
	 * @param courseId
	 */
	public void setCourseId(int courseId)
	{
		this.courseId = courseId;
	}

	/**
	 * Method 'getInstructorId'
	 * 
	 * @return int
	 */
	public int getInstructorId()
	{
		return instructorId;
	}

	/**
	 * Method 'setInstructorId'
	 * 
	 * @param instructorId
	 */
	public void setInstructorId(int instructorId)
	{
		this.instructorId = instructorId;
	}

	/**
	 * Method 'getInstitutionId'
	 * 
	 * @return int
	 */
	public int getInstitutionId()
	{
		return institutionId;
	}

	/**
	 * Method 'setInstitutionId'
	 * 
	 * @param institutionId
	 */
	public void setInstitutionId(int institutionId)
	{
		this.institutionId = institutionId;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof CourseRelation)) {
			return false;
		}
		
		final CourseRelation _cast = (CourseRelation) _other;
		if (id != _cast.id) {
			return false;
		}
		
		if (courseId != _cast.courseId) {
			return false;
		}
		
		if (instructorId != _cast.instructorId) {
			return false;
		}
		
		if (institutionId != _cast.institutionId) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + id;
		_hashCode = 29 * _hashCode + courseId;
		_hashCode = 29 * _hashCode + instructorId;
		_hashCode = 29 * _hashCode + institutionId;
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return CourseRelationPk
	 */
	public CourseRelationPk createPk()
	{
		return new CourseRelationPk(id);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "com.swe.chums.dao.dto.CourseRelation: " );
		ret.append( "id=" + id );
		ret.append( ", courseId=" + courseId );
		ret.append( ", instructorId=" + instructorId );
		ret.append( ", institutionId=" + institutionId );
		return ret.toString();
	}

}
